import lombok.RequiredArgsConstructor;
import me.zhengjie.exception.BadRequestException;
import me.zhengjie.service.GenConfigService;
import me.zhengjie.service.GeneratorService;
import me.zhengjie.service.impl.GeneratorServiceImpl;
import me.zhengjie.utils.GenUtil;
import org.junit.jupiter.api.Test;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

@RestController
@RequiredArgsConstructor
public class Demo1 {
    private final GeneratorService generatorService;
    private final GenConfigService genConfigService;


    @Test
    void test1(){


        try {
            GenUtil.generatorCode(generatorService.getColumns("account_ac08"),genConfigService.find("account_ac08"));
        } catch (IOException e) {
            throw new BadRequestException("生成失败，请手动处理已生成的文件");
        }
    }
}
